package com.yanqu.road.entity.activity.signindraw;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.date.DateHelper;

import java.util.Objects;

@FieldTypeAnnotation(tableName = "t_u_sign_in_draw_data")
public class SignInDrawUserData extends DataObject {

    @FieldTypeAnnotation(select = true, update = true, desc = "活动ID")
    private int activityId;

    @FieldTypeAnnotation(select = true, update = true, desc = "玩家ID")
    private long userId;

    @FieldTypeAnnotation(desc = "签到天数")
    private int signDay;

    @FieldTypeAnnotation(desc = "免费抽奖次数")
    private int freeTimes;

    @FieldTypeAnnotation(desc = "今日签到")
    private int todaySign;

    @FieldTypeAnnotation(desc = "今日分享")
    private int todayShare;

    @FieldTypeAnnotation(desc = "重置时间")
    private int resetTime;

    @FieldTypeAnnotation(desc = "近n天有登录")
    private int activeDay = -1;

    @FieldTypeAnnotation(desc = "实物奖励")
    private String reward = "";

    @FieldTypeAnnotation(desc = "今日在线时长领取状态")
    private int todayOnline;

    @FieldTypeAnnotation(desc = "今日已在线时长(秒)")
    private int todayOnlineTime;

    //在线计时的起始时间，默认等于lastLoginTime，如果在线隔天，则需要重置
    @FieldTypeAnnotation(desc = "今日在线计时的起始时间")
    private int onlineTimingStart;

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if(this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public int getSignDay() {
        return signDay;
    }

    public void setSignDay(int signDay) {
        if(this.signDay != signDay) {
            this.signDay = signDay;
            setUpdateOption();
        }
    }

    public int getFreeTimes() {
        return freeTimes;
    }

    public void setFreeTimes(int freeTimes) {
        if(this.freeTimes != freeTimes) {
            this.freeTimes = freeTimes;
            setUpdateOption();
        }
    }

    public int getTodaySign() {
        return todaySign;
    }

    public void setTodaySign(int todaySign) {
        if(this.todaySign != todaySign) {
            this.todaySign = todaySign;
            setUpdateOption();
        }
    }

    public int getTodayShare() {
        return todayShare;
    }

    public void setTodayShare(int todayShare) {
        if(this.todayShare != todayShare) {
            this.todayShare = todayShare;
            setUpdateOption();
        }
    }

    public int getResetTime() {
        return resetTime;
    }

    public void setResetTime(int resetTime) {
        if(this.resetTime != resetTime) {
            this.resetTime = resetTime;
            setUpdateOption();
        }
    }

    public int getActiveDay() {
        return activeDay;
    }

    public void setActiveDay(int activeDay) {
        if(this.activeDay != activeDay) {
            this.activeDay = activeDay;
            setUpdateOption();
        }
    }

    public String getReward() {
        return reward;
    }

    public void setReward(String reward) {
        if(!Objects.equals(this.reward, reward)) {
            this.reward = reward;
            setUpdateOption();
        }
    }

    public int getTodayOnline() {
        return todayOnline;
    }

    public void setTodayOnline(int todayOnline) {
        if(this.todayOnline != todayOnline) {
            this.todayOnline = todayOnline;
            setUpdateOption();
        }
    }

    public int getTodayOnlineTime() {
        return todayOnlineTime;
    }

    public void setTodayOnlineTime(int todayOnlineTime) {
        if(this.todayOnlineTime != todayOnlineTime) {
            this.todayOnlineTime = todayOnlineTime;
            setUpdateOption();
        }
    }

    public int getOnlineTimingStart() {
        return onlineTimingStart;
    }

    public void setOnlineTimingStart(int onlineTimingStart) {
        if(this.onlineTimingStart != onlineTimingStart) {
            this.onlineTimingStart = onlineTimingStart;
            setUpdateOption();
        }
    }
}
